{include file='common/header_test' /}

<main id="main">

	<div class="container">

		<div class="row topspace">
			
			<!-- Sidebar -->
			<aside class="col-sm-3 sidebar sidebar-right">

				
                <h1 class="text-center">搜索</h1>
                <hr>
                <!--<form method="get" action="/index/content/search">
                <div class="col-sm-10">
                    <div class="input-group">
                        <input type="text" class="form-control" name="q" value="{$q}" placeholder="Search for...">
                        <span class="input-group-btn">
                            <button class="btn btn-default" type="button">Go!</button>
                        </span>
                    </div>
                </div>-->
                
                <div class="search bar1">
                    <form method="get" name="frm2" action="/index/content/search" target="_blank" onsubmit="return searchOnsubmit2();" style="width:100%;"> 
                        <input type="text" placeholder="搜索..." size="12" name="q" value="{$q}" tabindex="4"> 
                        <button type="submit" onclick="search2();return false;">搜索</button>
                    </form>
                    <script>
                        function searchOnsubmit2() {
                            if (frm2.q.value == '') {
                                alert('请输入检索关键字！');
                                frm2.q.focus();
                                return false;
                            }
                        }

                        function search2() {
                            if (frm2.q.value == '') {
                                alert('请输入检索关键字！');
                                frm2.q.focus();
                                return false;
                            } else {
                                frm2.submit();
                            }
                        }
                    </script>
                </div> 
                
                <!--<div class="input-group">
                        <input type="text" name="q" class="form-control" value="{$q}" placeholder="Search for...">
                        <span class="input-group-btn">
                            <button class="btn btn-default" type="submit">搜索</button>
                        </span>
                    </div>
                </form>-->
				
                

			</aside>
			<!-- /Sidebar -->

			<!-- Article main content -->
			<article class="col-sm-8 maincontent">
				<h2 class="col-main-h2">搜索结果</h2>
                
                <div class="list-group">
                {notempty name='q'}
                <hr>
                    {notempty name='lists'}
                        <div class="list-group">
                            {foreach name='lists' item='vo'}
                            <div class="list-group-item">
                                <a href="{$vo.url}">
                                    <h3>{:str_replace([$q],['<span style="color:red;font-weight: bolder;">'.$q.'</span>'],$vo['shorttitle'])}</h3>
                                </a>
                                <p>{:str_replace([$q],['<span style="color:red;font-weight: bolder;">'.$q.'</span>'],$vo['description'])}</p>
                            </div>
                            {/foreach}
                        </div>
                        {notempty name='page'}{$page}{/notempty}
                    {else/}
                        <div class="alert alert-danger">没有搜索到与 "<b class="text-danger"> {$q} </b>" 相关的结果</div>
                    {/notempty}
                {/notempty}
                </div>
                
			</article>
			
			<!-- /Article -->
			

		</div>
	</div>	<!-- /container -->
	
</main>
<br><br><br>

{include file='common/footer_test' /}